-
Notifications
You must be signed in to change notification settings - Fork 117
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Reverse ordering support for Task API #816
base: main
Are you sure you want to change the base?
Conversation
Hi @ma1581, thank you for your PR. 🙌 I merged the changes from the Thanks! |
Hi @Strift . thanks for notifying this. Glad to be part of this |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks a lot for your PR!
Next time I would ask you to make one change per PR, it makes it easier to review :)
@BeforeEach | ||
void beforeEach() { | ||
TimeZone.setDefault(TimeZone.getTimeZone("UTC")); | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why did you need to set this? And if "yes" why not to set this for the whole test suite?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is not necessary entirely, as it works find even without it. but when running the test cases locally test cases related to dates, they are bound to fail.
this will allow devs to be sure that no False negative happens when testing locally.
if my above reasoning is fine, will apply to this to entire test suite in a new commit
Task[] defaultTaskList = | ||
client.getTasks(new TasksQuery().setAfterEnqueuedAt(currentTime)).getResults(); | ||
Task[] reversedTaskList = | ||
client.getTasks(new TasksQuery().setAfterEnqueuedAt(currentTime).setReverse(true)) | ||
.getResults(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you map only the task ids here, and then you assert them later, so the test will be less complex to read.
Arrays.stream(defaultTaskList).map(Task::getUid).collect(Collectors.toList()); | ||
List<Integer> reversedTaskOrder = | ||
Arrays.stream(reversedTaskList).map(Task::getUid).collect(Collectors.toList()); | ||
assertFalse(originalTaskOrder.isEmpty()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can also remove one of these assertions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
removed assertFalse(reversedTaskOrder.isEmpty()
Hi @brunoocasali . |
Pull Request
Related issue
Fixes #798
What does this PR do?
PR checklist
Please check if your PR fulfills the following requirements:
Thank you so much for contributing to Meilisearch!